home *** CD-ROM | disk | FTP | other *** search
- '-------------Save as a plugin and it will write the SMS to Database---------
-
- 'Credit where credit due. ie none to me (orac) as copied, changed and messed around for hours just to get it to work
-
- 'C:\SMSText.mdb is path to MS Access Database
- 'SMSCollection is Table name
- 'SMSCollection Table has at least two fields named Msg and Sender, mine has a defaulted Now() field and automatic ID field.
-
-
- Class SmsMDBLog
-
- Private m_Self
- Private m_WinampState
-
- 'Some info about the plugin
- Public Property Get SHOWABLE() 'Do I have a menu?
- SHOWABLE = False
- End Property
- Public Property Get TITLE() 'What's my name?
- TITLE = "On SMS Write DB"
- End Property
- Public Property Get DESCRIPTION() 'What's my purpose?
- DESCRIPTION = "This will Append the new SMS to File"
- End Property
- Public Property Get AUTHOR() 'Who created me?
- AUTHOR = "orac"
- End Property
- Public Property Get URL() 'Were can I be found? Where can you get more information?
- URL = "No where yet"
- End Property
-
- 'Who am I?
- Public Property Let Self(s)
- m_Self = s
-
- EventManager.RegisterEvent "NewSMS", s & ".WriteSMS", Me
- End Property
-
- Public Property Get Self()
- Self = m_Self
- End Property
-
- Sub WriteSMS(S, T)
- Dim adoCon, rs, strSql
-
- Set adoCon = CreateObject("ADODB.Connection")
- 'Set an active connection to the Connection object using a DSN-less connection
- adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= C:\SMSText.mdb"
-
-
- 'Create an ADO recordset object
- Set rs = CreateObject("ADODB.Recordset")
-
- 'Initialise the strSQL variable with an SQL statement to query the database
- strSQL = "SELECT SMSCollection.* FROM SMSCollection"
-
- rs.CursorType = 2
- rs.LockType = 3
-
- rs.Open strSQL, adoCon
- rs.AddNew
-
- Dim Sender, text
- text = T
- Sender = S
- Debug.DebugMsg "Saving NewSMS to Database " & "C:\SMSText.mdb"
- rs.Fields("Msg") = text
- rs.Fields("Sender") = Sender
- rs.update
-
- Set rs = Nothing
- Set adoCon = Nothing
- End Sub
-
- End Class
-